package cn.z2huo.demo.spring.transactional.service;

import cn.z2huo.demo.spring.transactional.dao.UserDAO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *
 * @author z2huo
 */
@Service
@RequiredArgsConstructor
public class UserService2 {

    private final UserDAO userDAO;

    @Transactional(propagation = Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED)
    public void updateUserValidFlag(String userCode, Long userId) {
        userDAO.updateUserValidFlag(userCode, userId);
    }

}
